{echo:JS::import('dialog?skin=brief');}
{echo:JS::import('dialogtools');}
{echo:JS::import('form');}
<div id="card_box" style="width:600px;">
    <h2 class="page_title tc" style="border:none">店铺信息</h2>
    <div class="form2">
        <form  id="export_form" action="{url:/customer/dp_act}" method="post" callback="create_voucher" enctype="multipart/form-data">
        <!--<input type="hidden" name="sq_id" value="{$dp['sq_id']}">-->
        <input type="hidden" name="user_id" value="{$id}">
        <table class="default mt10" style="border-left:0;border-right:0;">
            <tr>
                <th style="width:100px">店铺名称：</th>
                <td><input  type="text" id ="dp_name" name="dp_name" ><i  style="color:red;" id ="dp_message"></i></td>
            </tr>
            <tr>
             <tr>
            <th>固定电话：</th>

            <td> <input type="text" pattern = "(\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$" name="dp_tel" ></td>
             </tr>

            <tr>
                <th>店铺图片</th>
                <td><input  pattern="required"   type="file" name="dp_logo" ></td>
            </tr>
            <!--<tr><th>机构代码：</th> <td>{$dp['dp_dm']}</td></tr>-->
            <!--<tr><th>所属行业：</th> <td>{echo:Zyk_tj::zyk_info('goods_category',$dp['category_id'],'name')}</td></tr>-->
            <!--<tr><th>所在地区：</th> <td>{echo:Zyk_tj::zyk_info('area',$dp['province'],'name')} - {echo:Zyk_tj::zyk_info('area',$dp['city'],'name')} - {echo:Zyk_tj::zyk_info('area',$dp['county'],'name')}</td></tr>-->
            <!--<tr><th>详细地址：</th> <td>{$dp['dp_addr']}</td></tr>-->

            <!--<tr>-->
            	<!--<th>营业执照</th>-->
            	<!--<td><img src="{$dp['dp_pic']}" style="width:300px;height:180px;"/></td>-->
            <!--</tr>-->
            <!-- <tr>
                <th>处理结果：</th> <td colspan="3"><input type="radio" checked="checked" name="status" value="1" ><label>同意</label> <input type="radio" name="status" value="2" ><label>拒绝</label> <label  class="red">(注:拒绝后，账户余额自动扣除。)</label></td>
            </tr>
            <tr>
                <th>处理意见：</th> <td colspan="3"><textarea name="re_note"></textarea></td>
            </tr> -->
        </table>
        <div class="tc mt10"><button class="button">通过</button></div>
        </form>
    </div>
</div>
<script type="text/javascript">
    $(function () {
        $("#dp_name").blur(function () {

            $("#dp_message").text("");
            $("#dp_name").css("border","solid 1px #FFFFFF");

            var dp_name = $("#dp_name").val();

            $.get("{url:/customer/dp_name_ref}",{dp_name:dp_name},function(data){
                                                //如果返回是个数组,为什么 data['status'] 不显示值
                var json = eval(data);
                if(json == 'error1'){               //店铺名不能为空
                    $("#dp_message").text("店铺名不能为空");
                    $("#dp_name").css("border","solid 1px  red");

                }
                if(json == "error2")               //店铺名重复
                {
                    $("#dp_message").text("店铺名已经存在");
                    $("#dp_name").css("border","solid 1px  red");
                }
            });
        });




    });
</script>